home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / mx / remoting / Operation.as < prev    next >
Text File  |  2007-11-08  |  2KB  |  75 lines

  1. class mx.remoting.Operation
  2. {
  3.    function Operation(methodName, parent)
  4.    {
  5.       this.__service = parent;
  6.       this.__responder = parent.responder;
  7.       this.__methodName = methodName;
  8.       this.__invokationName = this.__service.__get__name() + "." + methodName;
  9.       this.__request = new Object();
  10.       this.__arguments = new Array();
  11.    }
  12.    function createThenSend(Void)
  13.    {
  14.       this.createArguments();
  15.       return this.send();
  16.    }
  17.    function send(Void)
  18.    {
  19.       this.__service.log.logInfo("Invoking " + this.__methodName + " on " + this.__service.__get__name());
  20.       var _loc3_ = new mx.remoting.PendingCall(this.__service,this.__methodName);
  21.       _loc3_.__set__responder(this.__responder);
  22.       var _loc2_ = null;
  23.       if(this.__arguments == null)
  24.       {
  25.          _loc2_ = new Array();
  26.       }
  27.       else
  28.       {
  29.          _loc2_ = this.__arguments.concat();
  30.       }
  31.       this.__invokationName = this.__service.__get__name() + "." + this.__methodName;
  32.       _loc2_.unshift(this.__invokationName,_loc3_);
  33.       this.__service.__get__connection().call.apply(this.__service.__get__connection(),_loc2_);
  34.       return _loc3_;
  35.    }
  36.    function invoke(a)
  37.    {
  38.       this.__arguments = a;
  39.    }
  40.    function get responder()
  41.    {
  42.       return this.__responder;
  43.    }
  44.    function set responder(r)
  45.    {
  46.       this.__responder = r;
  47.    }
  48.    function get request()
  49.    {
  50.       return this.__request;
  51.    }
  52.    function set request(r)
  53.    {
  54.       this.__request = r;
  55.    }
  56.    function get name()
  57.    {
  58.       return this.__methodName;
  59.    }
  60.    function createArguments()
  61.    {
  62.       if(this.__request != null)
  63.       {
  64.          this.__arguments = new Array();
  65.          for(var _loc2_ in this.__request)
  66.          {
  67.             if(_loc2_ != "arguments")
  68.             {
  69.                this.__arguments.unshift(this.__request[_loc2_]);
  70.             }
  71.          }
  72.       }
  73.    }
  74. }
  75.